<%--
  Created by IntelliJ IDEA.
  User: teacher
  Date: 2022/12/15
  Time: 13:46
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta charset="UTF-8">
    <title>用户登录</title>
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-3.4.1.min.js"></script>
    <script>
        $(function(){
           $("img").click(function(){
               // 在js中可以使用EL表达式,在引号中使用
               $(this).attr("src","${pageContext.request.contextPath}/showCode?id="+new Date().getTime());
           })
        });
    </script>
</head>
<body>
<h1>用户登录</h1>
<a href="${pageContext.request.contextPath}/jsp/register.jsp">返回注册</a>
<hr>
<form action="${pageContext.request.contextPath}/login.user" method="post">
    用户名:<input type="text" name="username"><br>
    密&nbsp;&nbsp;&nbsp;码:<input type="password" name="password"><br>
    验证码:<input type="text" name="code">
    <a href="javascript:;"><img src="${pageContext.request.contextPath}/showCode" alt="验证码加载失败"></a><br>
    <input type="submit" value="登录">
    <span style="color:red;">${loginMsg}</span>
</form>
</body>
</html>